const app = getApp();
Page({
    data: {
        datetimeflag: false,
        currentDate: Date.parse(new Date()),
        minDate: 1230739200000,
        datename:'',
        formatter(type, value) {
            if (type === 'year') { return `${value}年`}
            else if (type === 'month') { return `${value}月`}
            return value;
          },
        areaList:'',
        sexArr:['男生','女生'],
        sexflag: 0,
        fileList: [
           
        ]
    },

    tabCheck(e){
        this.setData({sexflag: e.currentTarget.dataset.idx})
    },

    closePopuparea(){
        this.setData({popupAreaflag: false})
    },

    showPopuparea(){
        this.setData({popupAreaflag: true})
    },

    showPopupdatetime(){
        this.setData({ datetimeflag: true })
    },

    datetimeConfirm(event) {
        let myDate = new Date(event.detail);
        let year = myDate.getFullYear();
        let Mmonth = myDate.getMonth() + 1;
        let Dday = myDate.getDate();
        this.setData({datename: year + '/' + (Mmonth < 10 ? '0' + Mmonth : Mmonth) + '/' + (Dday < 10 ? '0' + Dday : Dday)});
        console.log( year + '/' + (Mmonth < 10 ? '0' + Mmonth : Mmonth) + '/' + (Dday < 10 ? '0' + Dday : Dday))
        this.datetimeClose();
    },

    datetimeClose(){ 
        this.setData({ datetimeflag: false })
    },

    selectArea(e){
        console.log(e.detail.values);
        this.closePopuparea();
    }

})